package com.healthcloud.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.healthcloud.entity.AreaCode;
import com.healthcloud.entity.Condition;

public interface AreaCodeMapper extends CRUDMapper<AreaCode, Long> {

    List<AreaCode> searchAll();

    List<AreaCode> searchFromTable(@Param("conditions") List<Condition<Object>> conditions, @Param("table") String table);

    AreaCode findByCode(@Param("code") Long code, @Param("table") String table);

    int save(@Param("entity") AreaCode entity, @Param("table") String table);

    List<AreaCode> getLowerAreaListByLargeAreaCode(@Param("largeAreaCode") String largeAreaCode);

    List<AreaCode> getLowerAreaListByCode(@Param("code") String code);

    List<AreaCode> getLowerAreaListByCodeLevel(@Param("code") String code, @Param("level") Integer level);

    List<AreaCode> getLowerAreaExtraListByCode(@Param("code") String code);

    int updateLargeAreaCodeById(@Param("id") String id, @Param("largeAreaCode") String largeAreaCode);

    int updateLargeAreaCode(@Param("largeAreaCodeOld") String largeAreaCodeOld, @Param("entity") AreaCode entity);

    void setLargeAreaCodeNull(@Param("largeAreaCode") String largeAreaCode);

    List<AreaCode> getLowersAreaList(@Param("code") Long code, @Param("level") Integer level);

    List<AreaCode> findByAreaNameInAreaCode(@Param("areaName") String areaName, @Param("level") Integer level, @Param("baseAreaCode") String baseAreaCode);
}
